package com.xhl.service.impl;

import com.xhl.entity.User;
import com.xhl.service.UserClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

//降级
@Component
public class UserClientServiceFallbackFactory  implements FallbackFactory<UserClientService> {
    @Override
    public UserClientService create(Throwable cause) {
        return new UserClientService() {
            @Override
            public List<User> queryUserAll() {
                return new ArrayList<>();
            }
        };
    }
}
